(global.webpackJsonp = global.webpackJsonp || []).push([ [ "punchcard/punchcard" ], {
    "383d": function(t, e, i) {
        (function(t) {
            Object.defineProperty(e, "__esModule", {
                value: !0
            }), e.default = void 0;
            var a = i("db8f"), n = i("a71e"), s = i("bc33"), r = i("8434"), c = i("b806"), d = i("7960"), o = (h(i("03b8")), 
            h(i("801c")));
            function h(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            function u(t, e) {
                var i = Object.keys(t);
                if (Object.getOwnPropertySymbols) {
                    var a = Object.getOwnPropertySymbols(t);
                    e && (a = a.filter(function(e) {
                        return Object.getOwnPropertyDescriptor(t, e).enumerable;
                    })), i.push.apply(i, a);
                }
                return i;
            }
            function l(t, e, i) {
                return e in t ? Object.defineProperty(t, e, {
                    value: i,
                    enumerable: !0,
                    configurable: !0,
                    writable: !0
                }) : t[e] = i, t;
            }
            var g = {
                components: {},
                computed: function(t) {
                    for (var e = 1; e < arguments.length; e++) {
                        var i = null != arguments[e] ? arguments[e] : {};
                        e % 2 ? u(Object(i), !0).forEach(function(e) {
                            l(t, e, i[e]);
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : u(Object(i)).forEach(function(e) {
                            Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(i, e));
                        });
                    }
                    return t;
                }({}, (0, i("26cb").mapGetters)([ "configs", "mainColor", "user" ])),
                data: function() {
                    return {
                        tab: 0,
                        dates: [ {
                            value: "日",
                            day: ""
                        }, {
                            value: "一",
                            day: ""
                        }, {
                            value: "二",
                            day: ""
                        }, {
                            value: "三",
                            day: ""
                        }, {
                            value: "四",
                            day: ""
                        }, {
                            value: "五",
                            day: ""
                        }, {
                            value: "六",
                            day: ""
                        } ],
                        data: [ {
                            class: "iconfont iconrili1",
                            title: "日历"
                        }, {
                            class: "iconfont iconpaihangbang",
                            title: "排行榜"
                        }, {
                            class: "iconfont iconjilu4",
                            title: "打卡详情"
                        }, {
                            class: "iconfont iconriqian",
                            title: "生成日签"
                        } ],
                        puchcardId: "",
                        rest_day: "",
                        punchcard: "",
                        tabType: 0,
                        isShow: !1,
                        tabFixed: "",
                        type: 1,
                        mainColorh: "",
                        initData: "",
                        MemberList: [],
                        Membertotal: 0,
                        DiaryList: [],
                        Diarytotal: 0,
                        innerAudioContext: "",
                        Diarypage: 1,
                        Diarypagesize: 10,
                        loadingText: "下拉加载更多",
                        Memberpage: 1,
                        Memberpagesize: 10,
                        isAudioplay: !1,
                        isNomember: !1,
                        isnoDiary: !1,
                        topColor: "",
                        show_share: !1,
                        params: {
                            type: 9,
                            id: ""
                        },
                        listNumber: 0,
                        isBtn: !1
                    };
                },
                created: function() {
                    this.topColor = (0, a.colorRgba)("#000000", .1);
                },
                onLoad: function(t) {
                    var e = this;
                    this.puchcardId = t.id || (0, a.getPageId)(e).id, this.params.id = this.puchcardId, 
                    (0, n.isEmpty)(t.pid) || o.default.commit("config/SET_PID", t.pid), (0, n.isEmpty)(decodeURIComponent(t.scene).split("pid=")[1]) || o.default.commit("config/SET_PID", decodeURIComponent(t.scene).split("pid=")[1]), 
                    (0, c.init)(this).then(function(t) {
                        e.getDetail(), e.mainColorh = (0, a.colorRgba)(e.mainColor, .5), e.getDiaryList();
                    }).catch(function(t) {
                        return console.log(t);
                    });
                },
                onReachBottom: function() {
                    this.pullUp();
                },
                onShow: function() {},
                methods: {
                    initDatas: function() {
                        var t = this, e = 6 - t.setWeek(t.getWeek(0)), i = t.setWeek(t.getWeek(0));
                        t.tab = t.setWeek(t.getWeek(0)), t.tabFixed = t.setWeek(t.getWeek(0)), t.dates[t.setWeek(t.getWeek(0))].day = new Date().getDate(), 
                        t.dates[t.setWeek(t.getWeek(0))].date = t.getDates(0), t.dates[t.setWeek(t.getWeek(0))].isActivity = !0;
                        var a = 0 == t.tab ? "7" : t.tab + "";
                        if (t.dates[t.setWeek(t.getWeek(0))].isWeek = t.rest_day.includes(a), t.initData = t.getDates(0), 
                        e > 0) for (var n = 1; n < e + 1; n++) {
                            t.dates[t.setWeek(t.getWeek(-n))].day = t.getDay(n), t.dates[t.setWeek(t.getWeek(-n))].date = t.getDates(n);
                            var s = 0 == new Date(t.getDates(n)).getDay() ? "7" : new Date(t.getDates(n)).getDay() + "";
                            t.dates[t.setWeek(t.getWeek(-n))].isActivity = !1, t.dates[t.setWeek(t.getWeek(-n))].isWeek = t.rest_day.includes(s);
                        }
                        if (i > 0) for (var r = 1; r < i + 1; r++) {
                            t.dates[t.setWeek(t.getWeek(r))].day = t.getDay(-r), t.dates[t.setWeek(t.getWeek(r))].date = t.getDates(-r);
                            var c = 0 == new Date(t.getDates(-r)).getDay() ? "7" : new Date(t.getDates(-r)).getDay() + "";
                            t.dates[t.setWeek(t.getWeek(r))].isActivity = !t.rest_day.includes(c), t.dates[t.setWeek(t.getWeek(r))].isWeek = t.rest_day.includes(c);
                        }
                    },
                    itemDk: function(e, i) {
                        var a = this, n = new Date().getFullYear(), s = new Date().getMonth() + 1, r = new Date().getDate(), c = (new Date().getTime(), 
                        n + "-" + this.doHandleMonth(s) + "-" + this.doHandleMonth(r)), d = n + "/" + this.doHandleMonth(s) + "/" + this.doHandleMonth(r) + " " + this.punchcard.time1 + ":00", o = n + "/" + this.doHandleMonth(s) + "/" + this.doHandleMonth(r) + " " + this.punchcard.time2 + ":00", h = new Date(c).getTime(), u = (new Date(d).getTime(), 
                        new Date(o).getTime(), e.date.split("-"));
                        u[1] = this.doHandleMonth(u[1]), u[2] = this.doHandleMonth(u[2]);
                        var l = 0 == new Date("".concat(u.join("-"))).getDay() ? "7" : new Date("".concat(u.join("-"))).getDay() + "", g = new Date("".concat(u.join("-"))).getTime();
                        return !this.between(u.join("-"), this.punchcard.start_time, this.punchcard.end_time) || a.rest_day.includes(l) ? (t.showToast({
                            title: "本日期不可打卡",
                            icon: "none",
                            duration: 1500
                        }), !1) : this.between(u.join("-"), this.punchcard.start_time, this.punchcard.end_time) && !a.rest_day.includes(l) && g > h ? (t.showToast({
                            title: "打卡日期未开始",
                            icon: "none",
                            duration: 1500
                        }), !1) : (this.between(u.join("-"), this.punchcard.start_time, this.punchcard.end_time) && !a.rest_day.includes(l) && g == h ? this.type = 1 : this.between(u.join("-"), this.punchcard.start_time, this.punchcard.end_time) && !a.rest_day.includes(l) && g < h && (this.type = 2), 
                        this.tab = i, this.initData = u.join("-"), void a.isDiaryLists(this.initData));
                    },
                    isDiaryLists: function(t) {
                        var e = this;
                        this.isBtn = !1;
                        var i = {
                            page: 1,
                            pagesize: 10,
                            punchcard_id: this.puchcardId,
                            date: t
                        };
                        (0, s.diaryList)(i).then(function(t) {
                            e.listNumber = t.list.length, e.isBtn = !0;
                        });
                    },
                    between: function(t, e, i) {
                        var a = new Date(t).getTime(), n = new Date(e).getTime(), s = new Date(i).getTime();
                        return a >= n && a <= s;
                    },
                    getDetail: function() {
                        var t = this, e = {
                            id: t.puchcardId
                        };
                        (0, s.punchcardInfo)(e).then(function(e) {
                            t.punchcard = e, t.rest_day = e.rest_day, t.isShow = !0, t.initDatas(), t.initBetween();
                        });
                    },
                    initBetween: function() {
                        var t = this, e = new Date().getFullYear(), i = new Date().getMonth() + 1, a = new Date().getDate(), n = (t.getDates(0), 
                        new Date().getTime(), new Date().getDay()), s = e + "-" + this.doHandleMonth(i) + "-" + this.doHandleMonth(a), r = e + "/" + this.doHandleMonth(i) + "/" + this.doHandleMonth(a) + " " + this.punchcard.time1 + ":00", c = e + "/" + this.doHandleMonth(i) + "/" + this.doHandleMonth(a) + " " + this.punchcard.time2 + ":00", d = (new Date(r).getTime(), 
                        new Date(c).getTime(), 0 == n ? "7" : n + "");
                        !t.rest_day.includes(d) && t.between(s, t.punchcard.start_time, t.punchcard.end_time) || (t.type = 3);
                    },
                    betweenTime: function() {
                        var e = new Date().getTime(), i = new Date().getFullYear(), a = new Date().getMonth() + 1, n = new Date().getDate(), s = i + "/" + this.doHandleMonth(a) + "/" + this.doHandleMonth(n) + " " + this.punchcard.time1 + ":00", r = i + "/" + this.doHandleMonth(a) + "/" + this.doHandleMonth(n) + " " + this.punchcard.time2 + ":00", c = new Date(s).getTime(), d = new Date(r).getTime();
                        return e >= c && e <= d || (t.showToast({
                            icon: "none",
                            title: "当前时间段未在打卡范围内",
                            duration: 1e3
                        }), !1);
                    },
                    choose: function(t) {
                        switch (t + "") {
                          case "0":
                            this.goClock();
                            break;

                          case "1":
                            (0, r.route)({
                                url: "/punchcard/rank",
                                type: 1,
                                data: {
                                    puchcardId: this.puchcardId
                                }
                            });
                            break;

                          case "2":
                            (0, r.route)({
                                url: "/punchcard/detail",
                                type: 1,
                                data: {
                                    id: this.puchcardId
                                }
                            });
                            break;

                          case "3":
                            this.poster();
                        }
                    },
                    poster: function() {
                        this.punchcard.today_daka ? this.$refs.BotShow.getPoster() : t.showToast({
                            icon: "none",
                            title: "今日未打卡!",
                            duration: 1e3
                        });
                    },
                    goClock: function() {
                        var t = this, e = {
                            start_time: this.punchcard.start_time,
                            end_time: this.punchcard.end_time,
                            daka_num: this.punchcard.daka_num,
                            time1: this.punchcard.time1,
                            time2: this.punchcard.time2,
                            kbk_num: this.punchcard.kbk_num,
                            text_limit: this.punchcard.text_limit,
                            img_limit: this.punchcard.img_limit,
                            audio_limit: this.punchcard.audio_limit,
                            video_limit: this.punchcard.video_limit,
                            card_notice: this.punchcard.card_notice,
                            card_desc: this.punchcard.card_desc,
                            jc_day_num: this.punchcard.jc_day_num
                        };
                        (0, d.h5JudgeLogin)(2).then(function(i) {
                            i || (0, r.route)({
                                url: "/punchcard/punchcardDetail",
                                type: 1,
                                data: {
                                    puchcardId: t.puchcardId,
                                    rest_day: JSON.stringify(t.rest_day),
                                    info: JSON.stringify(e)
                                }
                            });
                        });
                    },
                    goDetail: function(t) {
                        if (this.punchcard.kbk_num <= 0 && 2 == t) return !1;
                        if (!this.betweenTime() && 1 == t) return !1;
                        var e = {
                            text_limit: this.punchcard.text_limit,
                            img_limit: this.punchcard.img_limit,
                            audio_limit: this.punchcard.audio_limit,
                            video_limit: this.punchcard.video_limit,
                            card_notice: this.punchcard.card_notice,
                            card_desc: this.punchcard.card_desc
                        };
                        (0, r.route)({
                            url: "/punchcard/index",
                            type: 1,
                            data: {
                                puchcardId: this.puchcardId,
                                type: t,
                                info: JSON.stringify(e),
                                time: this.initData
                            }
                        });
                    },
                    changeCommenttab: function(t) {
                        this.tabType = t, 1 == t ? 0 == this.MemberList.length && this.getMemberList() : 0 == t && 0 == this.DiaryList.length && this.getDiaryList();
                    },
                    getMemberList: function() {
                        var t = this;
                        this.loadingText = "加载中...";
                        var e = {
                            page: this.Memberpage,
                            pagesize: this.Memberpagesize,
                            punchcard_id: this.puchcardId
                        };
                        (0, s.punchcardMemberList)(e).then(function(e) {
                            for (var i in e.list) t.MemberList.push(e.list[i]);
                            0 != e.list.length ? t.loadingText = "下拉加载更多" : t.loadingText = "没有更多了", t.Membertotal = e.total, 
                            0 == t.MemberList.length && (t.isNomember = !0, t.loadingText = "");
                        });
                    },
                    getDiaryList: function() {
                        var t = this;
                        this.loadingText = "加载中...";
                        var e = {
                            page: this.Diarypage,
                            pagesize: this.Diarypagesize,
                            punchcard_id: this.puchcardId
                        };
                        (0, s.diaryList)(e).then(function(e) {
                            for (var i in e.list) t.DiaryList.push(e.list[i]);
                            0 != e.list.length ? t.loadingText = "下拉加载更多" : t.loadingText = "没有更多了", t.Diarytotal = e.total, 
                            0 == t.DiaryList.length && (t.isnoDiary = !0, t.loadingText = "");
                        });
                    },
                    pullUp: function() {
                        0 == this.tabType ? (this.loadingText = "下拉加载更多", this.Diarypage = this.Diarypage + 1, 
                        this.getDiaryList()) : 1 == this.tabType && (this.loadingText = "下拉加载更多", this.Memberpage = this.Memberpage + 1, 
                        this.getMemberList());
                    },
                    setWeek: function(t) {
                        var e = new Map();
                        return e.set("日", 0), e.set("一", 1), e.set("二", 2), e.set("三", 3), e.set("四", 4), 
                        e.set("五", 5), e.set("六", 6), e.get(t);
                    },
                    getWeek: function(t) {
                        return t > new Date().getDay() ? "日一二三四五六".charAt(new Date().getDay() - t + 7) : "日一二三四五六".charAt(new Date().getDay() - t);
                    },
                    getDates: function(t) {
                        var e = new Date(), i = e.getTime() + 864e5 * t;
                        e.setTime(i);
                        var a = e.getFullYear(), n = e.getMonth(), s = e.getDate();
                        return a + "-" + (n = this.doHandleMonth(n + 1)) + "-" + (s = this.doHandleMonth(s));
                    },
                    getDay: function(t) {
                        var e = new Date(), i = e.getTime() + 864e5 * t;
                        e.setTime(i), e.getFullYear();
                        var a = e.getMonth(), n = e.getDate();
                        return a = this.doHandleMonth(a + 1), n = n;
                    },
                    doHandleMonth: function(t) {
                        var e = t;
                        return 1 == t.toString().length && (e = "0" + t), e;
                    }
                }
            };
            e.default = g;
        }).call(this, i("543d").default);
    },
    4617: function(t, e, i) {
        i.r(e);
        var a = i("67e7"), n = i("eef4");
        for (var s in n) "default" !== s && function(t) {
            i.d(e, t, function() {
                return n[t];
            });
        }(s);
        i("d57c");
        var r = i("f0c5"), c = Object(r.a)(n.default, a.b, a.c, !1, null, "3ead3754", null, !1, a.a, void 0);
        e.default = c.exports;
    },
    "535f": function(t, e, i) {},
    "67e7": function(t, e, i) {
        i.d(e, "b", function() {
            return a;
        }), i.d(e, "c", function() {
            return n;
        }), i.d(e, "a", function() {});
        var a = function() {
            var t = this, e = (t.$createElement, t._self._c, t.isShow && 2 == t.type && 0 == t.listNumber && t.isBtn ? parseInt(t.punchcard.kbk_num) : null);
            t.$mp.data = Object.assign({}, {
                $root: {
                    m0: e
                }
            });
        }, n = [];
    },
    "78ec": function(t, e, i) {
        (function(t) {
            i("1067"), a(i("66fd"));
            var e = a(i("4617"));
            function a(t) {
                return t && t.__esModule ? t : {
                    default: t
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = i, t(e.default);
        }).call(this, i("543d").createPage);
    },
    d57c: function(t, e, i) {
        var a = i("535f");
        i.n(a).a;
    },
    eef4: function(t, e, i) {
        i.r(e);
        var a = i("383d"), n = i.n(a);
        for (var s in a) "default" !== s && function(t) {
            i.d(e, t, function() {
                return a[t];
            });
        }(s);
        e.default = n.a;
    }
}, [ [ "78ec", "common/runtime", "common/vendor" ] ] ]);